<?php
/* 
* @Author: LDF QQ 47121862
* @Date:   2014-06-07 13:36:57
* @Last Modified by:   LDF QQ 47121862
* @Last Modified time: 2014-06-07 15:29:21
*/
class UserControl extends AuthControl{
	public $model;
	function __auto(){
		$this->model=K('user');
	}
	//用户列表
	function index(){
		$this->user = $this->model->all();
		$this->display();
	}
	//修改用户
	function edit(){
		if(IS_POST){
			if($this->model->editUser()){
				$this->success('修改用户成功');
			}else{
				$this->error('修改用户失败');
			}
		}else{
			$uid = Q('uid',0,'intval');
			$this->field=$this->model->find($uid);
			$this->display();
		}
		
	}
	//删除用户
	function del(){
		$this->model->del(Q('uid',0,'intval'))?$this->success('删除成功...'):$this->error('删除用户失败');
	}
}
